# D:/pythonWork/python3916/python.exe, D:\work\com.tixi.dky.kjtx.boot.be\..\upload\dkyKjtx\80134788-0704-4b09-a103-be040d274b47\ModelTrain.py, D:\work\com.tixi.dky.kjtx.boot.be\..\upload\dkyKjtx\80134788-0704-4b09-a103-be040d274b47, 100,100,100,100,100,100, speed,detectionRange,enemyStrength,enemyDistance,hp,enemyHp
# -*- coding: UTF-8 -*-
import joblib
import pandas as pd
import numpy as np
import sys
from sklearn.preprocessing import StandardScaler

# 获取参数
modelDir = sys.argv[1]
resultLabels = sys.argv[2].split(",")
# modelDir = "D:\\work\\com.tixi.dky.kjtx.boot.be\\..\\upload\\dkyKjtx\\sceneModel"
# resultLabels = "16ccfdef85cb428e99822a74c1274a84,2166e142fb00442dab6f74d1ebcb772a,4e147a30ea83488d8157dc6ecad7d610,623ea66a505b4748aa5f6a1051d72fa4,d91b1070916d42e58652e9d7ca79a4cb,730b39e283214de2afd2c330836c4b3b,ac64b5caa27e48ed861d1c6fcf50b9c6,940d3e0d9e3745758de52cd3c751fbf9,b1fb81736fde4f5792e1ff0c7fbd4ea4,64c7fb20d5f44966b89e868e2b013e7d,8a54246d25a943f1afc1d3a491735786,b953f15a23ac463e9be35df8cf2c494d,144dc5f8028943f8955b0093c3caaa35,bf9bba55190044bb889cb32ba7a39fe3,44ea97afb07844078650d09d59b12b91,d75669db48f44c9a82c3e903041c9c41,9bee18d8f57c4bc2a418465427046e1a,9736c5e2b0cb4e5eb1b943ce7a9f4728,442981c981d845f5b66bce43e6d1b80f,061d29245efd4d70b98d1583dc112fda,18d7b32d764f45a4a61577d30ad68b3d,54ba614d37d44553a2482a72e8c71bff,531b69bae1404a6fb43711e16750610f,e0b741ae65f1452e9fc772315c662f72,5fec9c5ded844f0b8c1c847ec83fb65c,2a731c577e94440ca34ddd2088ba2219,3a1c4125690645a38474f88214ce2bd8,1b0359196d2c4f94a246dec652073e89".split(",")
clf = joblib.load(f'{modelDir}/model.model')
x_data = pd.read_csv(f'{modelDir}/test.csv')
y_pred = clf.predict(x_data)
y_pred = np.round(y_pred).astype(int)
# 生成执行结果
pd.DataFrame(y_pred, columns=resultLabels).to_csv(f'{modelDir}/result.csv', index=False)
